package com.da.springtest.spring5.reactor;

import java.util.Arrays;
import java.util.List;

import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * @author JokerDa.
 * @date 2021/1/6 14:05
 * Description:
 */
public class ReactorDemo {
    public static void main(String[] args) {
        Flux.just(1, 2, 3, 4).subscribe(System.out::print);
        Mono.just(1).subscribe(System.out::println);

        Integer[] array = {1, 2, 3, 4};
        Flux.fromArray(array);

        List<Integer> list = Arrays.asList(array);
        Flux.fromIterable(list);

        Flux.fromStream(list.stream());

    }
}
